<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>userLogin</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script src="${pageContext.request.contextPath}/js/jQuery-3.0.0.js"></script>
    <script>
        $(document).ready(function () {
            $("#login").click(function () {
                var $name = $("#username").val();
                var $pass = $("#password").val();
                if($name == "" || $pass == ""){
                    alert("用户名密码不能为空");
                }else{
                    $("#form1").submit();
                }
            });
            $("#imgOne").click(function () {
                $(this).attr("src","./image.action?"+new Date());
            })
        });
    </script>
    <style type="text/css">
        td{
            height: 40px;
            line-height: 40px;
        }
        input{
            height: 25px;
            border: 1px solid black;
        }
        img{
            cursor: pointer;
        }
    </style>
</head>
<body>
    ${requestScope.errorInfo}
    ${pageContext.request.contextPath}
    <form action="${pageContext.request.contextPath}/user/login.action" method="post" id="form1">
        <table align="center" width="500px">
            <tr>
                <td width="180px" align="right">用户名:</td>
                <td><input type="text" id="username" name="username" maxlength="10"></td>
            </tr>
            <tr>
                <td align="right">密码:</td>
                <td><input type="password" id="password" name="password"></td>
            </tr>
            <tr>
                <td align="right">验证码:</td>
                <td><input type="text" id="imageCode" name="imageCode"><img id="imgOne" src="${pageContext.request.contextPath}/image.action" style="border: 1px solid black;"align="middle" title="看不清楚?点击刷新"></td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <input type="button" value="登录" id="login"/>&nbsp;&nbsp;&nbsp;&nbsp;
                    <input type="reset" value="取消" />
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
